package com.openweixin.sheknows.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RequestBody;
import com.openweixin.sheknows.common.Pager;
import com.openweixin.sheknows.service.UserNewAnswerService;
import com.openweixin.sheknows.domain.UserNewAnswer;
@Controller
@RequestMapping("/userNewAnswer")
public class UserNewAnswerController extends BaseController{

	@Autowired
	private UserNewAnswerService service;

	@RequestMapping
	public String toMain(){
		return "UserNewAnswer";
	}

	@RequestMapping("/list")
	@ResponseBody 
	public Pager<UserNewAnswer> list(Pager<UserNewAnswer> pager){
		pager = service.findByPager(pager);
		return pager;
	}

	@RequestMapping("/add")
	@ResponseBody 
	public String add(@RequestBody UserNewAnswer bean){
		service.save(bean);
		return SUCCESS; 
	}

	@RequestMapping("/update")
	@ResponseBody 
	public String update(@RequestBody UserNewAnswer bean){
		service.update(bean);
		return SUCCESS; 
	}

	@RequestMapping("/delete")
	@ResponseBody 
	public String delete(Integer[] ids){
		service.delete(ids);
		return SUCCESS; 
	}

}
